package com.mxy.myapplication.testtouchevent;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.MotionEvent;

import com.mxy.myapplication.R;
import com.mxy.myapplication.activity.BaseActivity;

public class TestTouchActivity extends BaseActivity {

  @Override
  protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_testtouch);
  }


  @Override
  public boolean dispatchTouchEvent(MotionEvent ev) {
    System.out.println("Activity   dispatchTouchEvent");
//    System.out.println(super.dispatchTouchEvent(ev));
    return super.dispatchTouchEvent(ev);
  }

  @Override
  public boolean onTouchEvent(MotionEvent event) {
    System.out.println("Activity   onTouchEvent");
    switch (event.getAction()) {
      case MotionEvent.ACTION_DOWN:
        System.out.println("Activity   ACTION_DOWN");
        break;
      case MotionEvent.ACTION_MOVE:
        System.out.println("Activity   ACTION_MOVE");
        break;
      case MotionEvent.ACTION_UP:
        System.out.println("Activity   ACTION_UP");
        break;
    }
//    System.out.println(super.onTouchEvent(event));
    return super.onTouchEvent(event);
  }
}
